import http from "../request";
const apibase = "/api/ItemtLimited";

//获取约束条件
var getItemtLimiteds = function (data) {
  return new Promise((resolve, reject) => {
    http
      .post(apibase + `/GetItemtLimiteds`, data)
      .then((res) => {
        resolve(res);
      })
      .catch((error) => {
        reject(error);
      });
  });
};

//新增约束条件
var addItemtLimited = function (data) {
  return new Promise((resolve, reject) => {
    http
      .post(apibase + `/AddItemtLimited`, data)
      .then((res) => {
        resolve(res);
      })
      .catch((error) => {
        reject(error);
      });
  });
};

//批量新增约束条件
var addItemtLimiteds = function (data) {
  return new Promise((resolve, reject) => {
    http
      .post(apibase + `/AddItemtLimiteds`, data)
      .then((res) => {
        resolve(res);
      })
      .catch((error) => {
        reject(error);
      });
  });
};

//修改约束条件
var updateItemtLimited = function (data) {
  return new Promise((resolve, reject) => {
    http
      .post(apibase + `/UpdateItemtLimited`, data)
      .then((res) => {
        resolve(res);
      })
      .catch((error) => {
        reject(error);
      });
  });
};

//批量修改约束条件
var updateItemtLimiteds = function (data) {
  return new Promise((resolve, reject) => {
    http
      .post(apibase + `/UpdateItemtLimiteds`, data)
      .then((res) => {
        resolve(res);
      })
      .catch((error) => {
        reject(error);
      });
  });
};

//删除约束条件
var deleteItemtLimited = function (data) {
  return new Promise((resolve, reject) => {
    http
      .post(apibase + `/DeleteItemtLimited`, data)
      .then((res) => {
        resolve(res);
      })
      .catch((error) => {
        reject(error);
      });
  });
};

export {
  deleteItemtLimited,
  updateItemtLimited,
  addItemtLimited,
  getItemtLimiteds,
  updateItemtLimiteds,
  addItemtLimiteds,
};
